SQLPlus能连上Oracle但是其他应用程序不能连上的解决办法 |
您所在的位置:网站首页 › oracle plsql连接数据库 › SQLPlus能连上Oracle但是其他应用程序不能连上的解决办法 |
SQLPlus能连上Oracle但是其他应用程序不能连上的解决办法
记一次改变oracle配置时出的问题
应用端程序无法登录 之前在自己的电脑上装了一个oracle做测试用,某一天误删除了自己的数据,想通过数据库闪回来找回数据,结果发现自己的数据库并没有打开闪回功能; 于是花了一个小时鼓捣一下把自己的数据库闪回功能打开了。成功之后重启服务,登录sqlplus能正常使用就没有再管了。 今天因为要测试一下写的脚本数据于是用plsql登录数据库,发现输入用户名密码之后一直卡在登录界面。 首先想到的是,PLSQL的监听文件是不是有错,或者无意中被修改了,打开看了一下并不是。 这就有点奇怪了,上网查了一下基本没有跟我相似的情况。只好自己排查。排查之路 首先先排除是否是PLSQL软件本身的问题,连接了一下公司的数据库,发现可以正常使用,软件是没有问题的。 然后查看其他数据库连接软件是否能连上,打开Navicat连接自己的数据库,依旧连接不上。 基本可以确定是我数据库的原因了,然后检查是否数据库软件出了问题。用Oracle自带的SQLPlus登录系统用户,发现可以登录,数据库软件是没有问题的。 确定原因 现在就已经明白了,用SQL plus可以正常登录,但是其他软件都不行,基本上就是监听程序的问题。因为SQL plus不需要使用监听程序连接Oracle数据库,但是第三方软件连接需要通过监听程序。 首先检查服务: 此电脑(右键)=>管理=>服务和应用程序=>服务 tnsnames: local naming naming method Set to resolve a net service name through the tnsnames.ora file on the client.(通过服务名查找,一般必开) hostname: host naming method Set to resolve a host name alias through an existing names resolution service or a centrally-maintained set of /etc/hosts files.(通过host查找,用navicat的时候没有打开这个所以连接不上) onames: Oracle Names method Set to resolve database objects through a Oracle Names server. ldap: directory naming naming method Set to resolve a database service name, net service name, or net service alias through a directory server. cds: Cell Directory Services (CDS) external naming method Set to resolve an Oracle database name in a Distributed Computing Environment (DCE) environment. nis: Network Information Service (NIS) external naming method Set to resolve service information through an existing NIS. Ezconnect:The easy connect naming method eliminates the need for service name lookup in the tnsnames.ora files for TCP/IP environments; in fact, no naming or directory system is required if you use this method.(这种连接方式,只需要服务端配置监听文件就可以了,而不需要再客户端配置tnsnames文件的连接串) 我选择了一个比较偷懒的办法,直接将hostname配置到文件中去,重启服务,成功连接!而且测试了闪回功能也没有问题。 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |